<template>
    <div class="filmnav">
        <div class="cityshow" @click="gocity">
            <van-dropdown-menu >
                <van-dropdown-item v-model="value" disabled :options="option1" />
            </van-dropdown-menu>
        </div>
        <div class="nav-film">
            <van-tabs v-model="active" @click="onClick" title-inactive-color="#666" title-active-color="#333">
                <van-tab  title="热映"></van-tab>
                <van-tab title="影院"></van-tab>
                <van-tab title="待映"></van-tab>
                <van-tab title="经典电影ssssssssss"></van-tab>
            </van-tabs>
        </div>
        <div class="search" @click="searchfilm">
            <img src="" alt="">
        </div>
    </div>
</template>
<script>
import Vue from 'vue';
import { Tab, Tabs,DropdownMenu, DropdownItem} from 'vant';

Vue.use(Tab);
Vue.use(Tabs);
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
export default {
    data() {
    return {
      value: 0,
      active:0,
      switch1: false,
      switch2: false,
      option1: [
        { text: '深圳', value: 0 }
      ],
      url:['/films/hotmovie','/films/cinema','/films/fmovie','/films/classic']
    };
  },
  created(){
      
  },
  mounted(){
      this.active = this.url.indexOf(this.$route.path)
      console.log(localStorage.getItem('cityid'));
        if(localStorage.getItem('cityname'))
        this.option1[0].text=localStorage.getItem('cityname')
        else 
        this.option1[0].text = '深圳'
  },
    methods: {
    onClick(index, title) {
        this.$router.push(this.url[index])
    },
    searchfilm(){
        console.log('找电影');
        this.$router.push('/search')
    },
    gocity(){
        this.$router.push('/city/:cityid')
    },
    
  },
}
</script>
<style scoped>
.filmnav {
    width:100%;
    position: fixed;
    top:51px;
    z-index: 100;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    border-top:1px solid #EBEBEB;
    border-bottom:1px solid #EBEBEB;
    padding-top:20px;
    background-color: white;
}
.cityshow {
    padding-left: 15px;
    font-size: 15px;
}
.nav-film {
    padding-left: 15px;
    font-size: 16px;
}
.van-tab{
     width:100px i !important;
}
.search img{
    padding-left: 10px;
    width:20px;
    height: 20px;
}

</style>